package edu.unlv.cs.ladders.entities;

import edu.unlv.cs.ladders.entities.Participant;
import java.lang.Long;
import java.util.List;

privileged aspect Participant_Roo_Entity {
    
    public static long Participant.countParticipants() {
        return (Long) entityManager().createQuery("select count(o) from Participant o").getSingleResult();
    }
    
    public static List<Participant> Participant.findAllParticipants() {
        return entityManager().createQuery("select o from Participant o").getResultList();
    }
    
    public static Participant Participant.findParticipant(Long id) {
        if (id == null) return null;
        return entityManager().find(Participant.class, id);
    }
    
    public static List<Participant> Participant.findParticipantEntries(int firstResult, int maxResults) {
        return entityManager().createQuery("select o from Participant o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
    }
    
}
